package com.nightsoul.groovy

/**
 * @author zj
 *
 */
public class AvoidNullPointerException{

	public static void main(def args){
		def map = [a:[b:[c:1]]];
		
		//assert  map.a.b.c == 1;
		
		if(map && map.a && map.a.b) {
			println map.a.b.c;
		}
		
		println map?.a?.b?.c;
	}
	
}
